package it.fuesi.synotools.model.filestation;

import java.io.Serializable;

import it.fuesi.synotools.model.base.IModel;

/**
 * Created by pascotto on 16/10/14.
 */
public class FileStationFile implements Serializable, IModel {

    private boolean isdir;
    private String name;
    private String path;
    private FileStationFileAdditional additional;

    private boolean selected;

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public long getSize(){
        if(additional != null)
            return additional.getSize();

        return 0;
    }

    public String getType(){
        if(additional != null)
            return additional.getType();

        return null;
    }

    public String getParentPath(){
        if(path != null && !path.isEmpty() && path.indexOf("/") >=0)
            return path.substring(0, path.lastIndexOf("/"));

        return null;
    }

    public boolean isdir() {
        return isdir;
    }

    public void setdir(boolean isdir) {
        this.isdir = isdir;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public FileStationFileAdditional getAdditional() {
        return additional;
    }

    public void setAdditional(FileStationFileAdditional additional) {
        this.additional = additional;
    }
}
